Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing 2 bugs related to failure scenarios #599

Conversation

yevgeny-shnaidman
Copy link
Contributor

First bug:
If during module deletion scenario, UnloadKmod function returns and error for some reason, the GarbageCollectInUseLabels and UpdateNodeLabelsAndRecordEvents onw't be called. This in turn means, that if there is a module that was being loaded/unloaded in parallel, the actual action will happen (load/unload from kernel), but the label in NMC and node won't be updated.
Solution: always continue with GarbageCollectInUseLabels and UpdateNodeLabelsAndRecordEvents and return a collective error later

Second bug:
In case ProcessModuleSpec from some spec/status has failed, the status would not be deleted from the statusMap, which will cause it later to be treated as orphaned status and the UnloadKmod to be called. Solution: always delete status from statusMap, even in case of a failure

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 10, 2023
@netlify
Copy link

netlify bot commented Oct 10, 2023

Deploy Preview for kubernetes-sigs-kmm ready!

Name Link
🔨 Latest commit e2b637c
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kmm/deploys/652551272a35b80008b8eb17
😎 Deploy Preview https://deploy-preview-599--kubernetes-sigs-kmm.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: yevgeny-shnaidman

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 10, 2023
First bug:
If during module deletion scenario, UnloadKmod function returns and
error for some reason, the GarbageCollectInUseLabels and UpdateNodeLabelsAndRecordEvents
onw't be called. This in turn means, that if there is a module that was
being loaded/unloaded in parallel, the actual action will happen
(load/unload from kernel), but the label in NMC and node won't be
updated.
Solution: always continue with GarbageCollectInUseLabels
and UpdateNodeLabelsAndRecordEvents and return a collective error later

Second bug:
In case ProcessModuleSpec from some spec/status has failed, the status
would not be deleted from the statusMap, which will cause it later to be
treated as orphaned status and the UnloadKmod to be called.
Solution: always delete status from statusMap, even in case of a failure
@yevgeny-shnaidman yevgeny-shnaidman force-pushed the yevgeny/fix-nmc-reconcile-errors branch from f0f93c3 to e2b637c Compare October 10, 2023 13:27
@qbarrand
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 10, 2023
@k8s-ci-robot k8s-ci-robot merged commit 70d3993 into kubernetes-sigs:main Oct 10, 2023
12 checks passed
qbarrand pushed a commit to qbarrand/kernel-module-management that referenced this pull request Nov 8, 2023
…ernetes-sigs#822)

First bug:
If during module deletion scenario, UnloadKmod function returns and
error for some reason, the GarbageCollectInUseLabels and UpdateNodeLabelsAndRecordEvents
onw't be called. This in turn means, that if there is a module that was
being loaded/unloaded in parallel, the actual action will happen
(load/unload from kernel), but the label in NMC and node won't be
updated.
Solution: always continue with GarbageCollectInUseLabels
and UpdateNodeLabelsAndRecordEvents and return a collective error later

Second bug:
In case ProcessModuleSpec from some spec/status has failed, the status
would not be deleted from the statusMap, which will cause it later to be
treated as orphaned status and the UnloadKmod to be called.
Solution: always delete status from statusMap, even in case of a failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants